#include<iostream>

using namespace std;

int main()
{
    int a[10] = {5 ,  4 , 6 , 8 , 7 , 9 , 1 , 2 , 3 , 0};
    cout << "排序前：" << endl;
    for(int i = 0; i < 10; i++)
    {
        cout << a[i] << " ";
    }
    cout << endl;
    for (int i = 0; i < 10; i++)
    {
        for (int j = 0; j < 9 - i; j++)
        {
            if (a[j] > a[j + 1])
            {
                int temp = a[j];
                a[j] = a[j + 1];
                a[j + 1] = temp;
            }
        }
    }
    cout << "排序后：" << endl;
    for(int i = 0; i < 10; i++)
    {
        cout << a[i] << " ";
    }
    cout << endl;
    
    
    
    return 0;
    
}